package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.Carousel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface CarouselMapper extends BaseMapper<Carousel> {

    /**
     * 根据传入数量返回轮播图列表
     * @param number 数量
     * @return
     */
    @Select("select id,img_url,img_title,img_link from tb_carousel order by create_date DESC limit #{n}")
    List<Carousel> selectByLimit(@Param("n") int number);
}
